<template>
  <div class="app-container">
    <!--表格渲染-->
    <div class="table_content">
      <el-table ref="table" v-loading="loading" :data="list" border style="width: 100%;" border
                :header-cell-style="{background: '#F8F8F9', color: '#515a6e',padding: '6px 0 !important'}">
        <el-table-column prop="projectType" fixed="left" label="工程类型">
          <template slot-scope="scope">
            {{{'0':'工程项目','1':'政府采购项目','2':'资产资源招标'}[scope.row.projectType]}}
          </template>
        </el-table-column>
        <af-table-column prop="reason" label="整改原因" />
        <af-table-column prop="desc" label="整改描述" />
        <af-table-column prop="needStop" label="是否暂停项目" />
        <af-table-column prop="status" label="监督用户名" />
        <el-table-column prop="status" label="整改状态" min-width="120">
          <template slot-scope="scope">
            {{{'0':'下达整改单','1':'整改后提交','2':'整改通过'}[scope.row.status]}}
          </template>
        </el-table-column>
        <el-table-column prop="rectifyTime" label="整改单下达时间" min-width="130"/>
        <el-table-column align="center" fixed="right" label="操作">
          <template slot-scope="scope">
            <el-button class="btn" type="text" size="small"
                       @click="handleEdit(scope.$index,scope.row)">去整改</el-button>
          </template>
        </el-table-column>
      </el-table>
      <!--分页-->
      <pagination v-show="total>0" :total="total"
                  :page.sync="listQuery.pageNum"
                  :limit.sync="listQuery.pageSize"
                  @pagination="getList" />
    </div>

  </div>
</template>

<script>
  import { doPost, doGet, doFile, doDownload } from '@/api/index'
  import Pagination from '@/components/Pagination/index'

  export default {
    name: "index.vue",
    components: {Pagination},
    data() {
      return {
        loading: false,
        list: [],
        total: 0,
        listQuery: {
          pageSize: 20,
          pageNum: 1
        }
      }
    },
    created() {
      this.getList()
    },
    methods: {
      getList() {
        this.loading = true
        doPost('supervise/page', this.listQuery).then(res => {
          this.loading = false
          this.list = res.data.list
          this.total = res.data.total
        }).catch(error => {
          this.loading = false
          this.list = []
          this.total = 0
        })
      },
      handleEdit(index, row){}
    },
  }
</script>

<style scoped>

</style>
